﻿/*****************************************************************//**
 * @file    FITKGraphObjectHighlightBase.h
 * @brief   Highlight data exchange base class.
 *  
 * @author  ChengHaotian (yeguangbaozi@foxmail.com)
 * @date    2024-04-10
 *********************************************************************/

#ifndef __FITKGRAPHOBJECTHIGHLIGHTBASE_H__
#define __FITKGRAPHOBJECTHIGHLIGHTBASE_H__

#include "FITKGraphObject3D.h"

#include "FITKVTKGraphAdaptorAPI.h"

// Forward declaration
class QVariant;

class FITKGraphActor;

namespace Core
{
    class FITKAbstractDataObject;
}

namespace Exchange
{
    /**
     * @brief   Base graph object for highlight graph, such as 'set' and 'surface'.
     * @author  ChengHaotian (yeguangbaozi@foxmail.com)
     * @date    2024-04-10
     */
    class FITKVTKGRAPHADAPTORAPI FITKGraphObjectHighlightBase : public FITKGraphObject3D
    {
        // Regist
        FITKGraphObjectRegist(FITKGraphObjectHighlightBase, FITKGraphObject3D);
        FITKCLASS(Exchange, FITKGraphObjectHighlightBase);

    public:
        /**
         * @brief   Constructor.
         * @param   caseData: The case data
         * @param   model: The input data need to be exchanged
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-10
         */
        FITKGraphObjectHighlightBase(AbaqusData::FITKDataCase* caseData, Core::FITKAbstractDataObject* dataObj);

        /**
         * @brief   Destructor.[virtual]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-10
         */
        virtual ~FITKGraphObjectHighlightBase() = default;

        /**
         * @brief   Set the color.( For highlighting 'set' and 'surface' only. )
         * @param   color: The color
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-05-22
         */
        virtual void setColor(QColor color) override;

        /**
         * @brief   Highlight the graph actors.[virtual][override]
         * @param   color: The given color for highlighting this time[default]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-05-23
         */
        virtual void highlight(QColor color = QColor()) override;

        /**
         * @brief   If the graph object has relation with the given data object id.[virtual][override]
         * @param   dataObjId: The data object id
         * @return  Has relation
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-05-24
         */
        virtual bool isRelatedTo(int dataObjId) override;

    protected:
        /**
         * @brief   Constructor.( For copying data )
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-10
         */
        FITKGraphObjectHighlightBase() = default;

        /**
         * @brief   Initialize the actor's visualization properties.[virtual][override]
         * @param   actor: The actor
         * @param   details: No used
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-10
         */
        virtual void initActorProperties(vtkProp* actor, QVariant details = QVariant()) override;
 
    protected:
        /**
         * @brief   All the object's parent models id, if the parent is invisible, then hide itself partly or fully.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-05-14
         */
        QList<int> m_modelIds;

        /**
         * @brief   The visibility of all parent models.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-05-14
         */
        QHash<int, bool> m_modelVisibilityHash;

    };
}   // namespace Exchange

#endif // __FITKGRAPHOBJECTHIGHLIGHTBASE_H__
